<?
function view_record_menu($result)
	{
		function pic($picName)
			{
				global $page;
				if (file_exists("images/content/menu/".$page."/".$picName.".jpg")) 
					{
							if (file_exists("images/content/menu/".$page."/".$picName."_b.jpg")) 
								{
									$a=@getimagesize("images/content/menu/".$page."/".$picName."_b.jpg");
									$w = $a[0];
									$h = $a[1]+2;
									echo "<a href=\"javascript:genWin('images/photo.php?photo=content/menu/".$page."/".$picName."_b.jpg','pic_".$picName."',0,0,0,0,0,".$w.",".$h.")\">";
									echo '<img src="images/content/menu/'.$page.'/'.$picName.'.jpg" alt="" border="0" width="130"></a>';
								}
							else { echo '<img src="images/content/menu/'.$page.'/'.$picName.'.jpg" alt="" border="0" width="130"></a>'; }
					}
				else { echo '&nbsp;';}
			}
		$level1="";
		$level2="";
		$level3="";
		while($menu=mysql_fetch_object($result)) 
			{
				if ($level1!=$menu->level1) { echo '<div style="text-align:center" style="color: #FF0000"><br /><b>'.strtoupper($menu->level1).'<br / >'.strtoupper($menu->level1_eng).'</b><br /></div>'; }
					
				if ($level1!=$menu->level1) 
					{ echo "\n\t\t\t".'<table width="100%" border="0" cellspacing="0" cellpadding="2" style="text-align:center;" ><!-- -->'; }
				if ($level2!=$menu->level2) { echo '<tr><th colspan="3" style="color: #FF6600"><br /><b>'.strtoupper($menu->level2).'<br />'.strtoupper($menu->level2_eng).'</b><br /></th></tr>'; }
				if ($level3!=$menu->level3) { echo '<tr><th colspan="3" style="color: #FF0000"><br /><b>'.strtoupper($menu->level3).'<br />'.strtoupper($menu->level3_eng).'</b><br /></th></tr>'; }
				
				if ($menu->ann!='') { $ann = '<small><i>'.str_replace("\n", ' ', $menu->ann).'</i></small><br />'; }
					else { $ann = ''; }
				
				if ($menu->ann_eng!='') { $ann_eng = '<small><i style="color: #00CCFF" >'.str_replace("\n", ' ', $menu->ann_eng).'</i></small><br />'; }
					else { $ann_eng = ''; }
				
				if ($menu->prim!='') { $prim = '<small><i>'.$menu->prim.'</i></small><br />'; }
					else { $prim = ''; }
				
				if ($menu->prim_eng!='') { $prim_eng = '<small><i style="color: #00CCFF" >'.$menu->prim_eng.'</i></small><br />'; }
					else { $prim_eng = ''; }
				
				if ($menu->weight!='') { $weight = '<small><i>'.$menu->weight.'</i></small><br />'; }
					else { $weight = ''; }
				
				if ($menu->price!=0.00) { $price = '<small><i>'.$menu->price.'</i></small><br />'; }
					else { $price = ''; }
					
				echo "\n\t\t\t\t<tr>";
				echo "\t\t\t\t".'
					<td class="main-left" valign="top" style="width:350px; text-align:left;" style="color: #000000"> '.$menu->name.'<br /><small style="color: #00CCFF">'.$menu->name_eng.'</small><br />
						'.$ann.'
						'.$ann_eng.'
						'.$prim.'
						'.$prim_eng.'
						
						<br />
					</td>
				';
				echo "\t\t\t\t".'<td class="main-left" valign="top">';
				pic($menu->photo);
				echo "\n\t\t\t\t".'</td>';
				
				echo "\t\t\t\t".'<td style="text-align:right;" valign="top">'.$price.''.$weight.'</td>';
				
				echo "\n\t\t\t\t</tr>";
					
					
					
				//*********************
				$level1=$menu->level1;
				$level2=$menu->level2;
				$level3=$menu->level3;
				$level1_eng=$menu->level1_eng;
				$level2_eng=$menu->level2_eng;
				$level3_eng=$menu->level3_eng;

			}
		echo '</table>';
	}
?>